package yxy.cherry.data.input;

public class Version {

	static public Version defaultVersion = new Version("v1", "v1.0.0.0");

	private String major = "v1";// 主版本号
	private int minor = 0;// 次版本号，当数据文件发生增减变化时更新
	private int build = 0;// 内版本号，当数据的键值发生变化时更新
	private int revision = 0;// 修订号，仅当数据内容发生变化时更新

	public Version(String majorVersion, String versionString) {
		String[] splits = versionString.split("\\.");
		major = majorVersion;
		minor = Integer.parseInt(splits[1]);
		build = Integer.parseInt(splits[2]);
		revision = Integer.parseInt(splits[3]);
	}

	@Override
	public String toString() {
		return String.format("%s.%d.%d.%d", major, minor, build, revision);
	}

}
